Steps of Cross-Compilation

Contents|Index|Previous|Next
Steps of cross-compilation

To compile and run a program using a cross-compiler involves three steps:.

1.
Run the cross-compiler on the host machine to produce assembler files for the target machine. This requires header files for the target machine.

2.
Assemble the files produced by the cross-compiler. You can do this either with an assembler on the target machine, or with a cross-assembler on the host machine.

3.
Link those files to make an executable. You can do this either with a linker on the target machine, or with a cross-linker on the host machine. Whichever machine you use, you need libraries and certain startup files (typically, crt.o) for the target machine.

It is most convenient to do all of these steps on the same host machine, since then you can do it all with a single invocation of GNU CC. This requires a suitable cross-assembler and cross-linker. For some targets, the GNU assembler and linker are available.